<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>指标解释</title>
  <%= stylesheet_link_tag 'main' %>
  <%= javascript_include_tag 'prototype' %>
  <%= javascript_include_tag 'effects' %>
  <%= javascript_include_tag 'fckeditor' %>
  <%= javascript_include_tag 'xtree', 'xmlextras', 'xloadtree', 'xradiotree', 'xradioloadtree', 'xcheckboxtree', 'xcheckboxloadtree', 'function'  %>
<head> 
</head> 
<body>

<script>
function show_update()
{
    element = document.getElementById("update_content");
    if (element.style.display=="none")
        element.style.display = "block";
    else
        element.style.display = "none";
}

function delete_catalog(id)
{
    form1.action = "/scalarexplain/delete_catalog/" + id;
    form1.submit(); 
}
</script>

<%if CheckRight(session[:user].id, "指标解释管理") && @catalogs.size==1%>
<div height=20% width=100% style="font-size:12">
    <%=start_form_tag({:action=>"modify_catalog", :id=>@catalogs[0].id},{:target=>'_parent', :name=>'form1'})%>
      修改分类名称：<%=text_field_tag "name", @catalogs[0].name%>
      <%= submit_tag '保存'%>
      <input type="button" value="删除" onclick="javascript:delete_catalog(<%=@catalogs[0].id%>)"/>
    <%=end_form_tag%>
    <a href="javascript:show_update()">上传指标解释</a>
    <div id="update_content" style="display:none">
    <%=start_form_tag :action=>"save_explain", :id=>@catalogs[0].id%>
      <%= submit_tag '保存'%>      
      <%@catalog = @catalogs[0]%>
      <%= fckeditor_textarea("catalog", "content",  :toolbarSet => 'Simple',:width => '100%', :height => '100%') %>
    <%=end_form_tag%>
    </div>
</div>
<%end%>

<div height=80% weight=100% style="font-size:12;font-family:'宋体'">
<% for catalog in @catalogs%>
  <% if @show_title%>
    <h2 align="left" style="background-color=#6666FF"><%=catalog.name%></h2>
  <% end%>
  <%= catalog.content%>
<% end%>
</div>

</body>
</html>